# 如果被装饰函数本身带有参数，那么装饰器函数也要带参数，以便正确的传递给被装饰函数
def decorator_function(func):
    def wrapper_function(*args, **kwargs):
        print("计算两个数字的和：")
        func(*args, **kwargs)
        print("求和函数执行完毕！")

    return wrapper_function


@decorator_function
def add_num(a, b):
    result = a + b
    print(f'{a} + {b} = {result}')


if __name__ == '__main__':
    add_num(1, 2)
